/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ia_project;

import java.util.Random;

/**
 *
 * @author Raphaël
 */
public class GenerateurNom {

    private static enum MajusculeType {

        A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
    };

    private static enum ConsoneType {

        b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, z
    };

    private static enum VoyelleType {

        a, e, i, o, u, y
    };
    private String nom;

    public String genererNom() {
        nom = "";
        Random rand = new Random();
        int nbLettres = 3 + rand.nextInt(5);
        int pick = new Random().nextInt(MajusculeType.values().length);
        nom = nom + MajusculeType.values()[pick];
        for (int i = 0; i < nbLettres; i++) {
            if ((i % 2) != 1) {
                pick = new Random().nextInt(VoyelleType.values().length);
                nom = nom + VoyelleType.values()[pick];
            } else {
                pick = new Random().nextInt(ConsoneType.values().length);
                nom = nom + ConsoneType.values()[pick];
            }
        }
        return nom;
    }
}
